<script setup lang='ts'>
import { onMounted, ref } from "vue";
import { getAnn } from "../api/api";
const data = ref()
onMounted(()=>{
    getData()
})
//获取公告
const getData = async() => {
    const res = await getAnn()
    data.value = res.data.data
}
</script>

<template>
    <van-notice-bar left-icon="volume-o" :scrollable="false">
        <van-swipe vertical class="notice-swipe" :autoplay="3000" :touchable="false" :show-indicators="false">
            <van-swipe-item v-for="i in data" :key="i._id">{{i.data}}</van-swipe-item>
        </van-swipe>
    </van-notice-bar>
</template>

<style scoped>
 .notice-swipe {
    height: 40px;
    line-height: 40px;
  }
</style>